package com.raitcon.hibernate.bean;
// Generated 27/05/2014 07:54:56 AM by Hibernate Tools 3.2.1.GA


import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * SubMenu generated by hbm2java
 */
@Entity
@Table(name="sub_menu"
    ,schema="public"
)
public class SubMenu  implements java.io.Serializable {


     private int idSubMenu;
     private Menu menu;
     private char state;
     private String name;
     private String description;
     private Date registryDate;
     private String pageName;
     private Set<RolesAccion> rolesAccions = new HashSet<RolesAccion>(0);
     private Set<RolesAccion> rolesAccions_1 = new HashSet<RolesAccion>(0);

    public SubMenu() {
    }

	
    public SubMenu(int idSubMenu, Menu menu, char state, String name) {
        this.idSubMenu = idSubMenu;
        this.menu = menu;
        this.state = state;
        this.name = name;
    }
    public SubMenu(int idSubMenu, Menu menu, char state, String name, String description, Date registryDate, String pageName, Set<RolesAccion> rolesAccions, Set<RolesAccion> rolesAccions_1) {
       this.idSubMenu = idSubMenu;
       this.menu = menu;
       this.state = state;
       this.name = name;
       this.description = description;
       this.registryDate = registryDate;
       this.pageName = pageName;
       this.rolesAccions = rolesAccions;
       this.rolesAccions_1 = rolesAccions_1;
    }
   
     @Id 
    
    @Column(name="id_sub_menu", unique=true, nullable=false)
    public int getIdSubMenu() {
        return this.idSubMenu;
    }
    
    public void setIdSubMenu(int idSubMenu) {
        this.idSubMenu = idSubMenu;
    }
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="id_menu", nullable=false)
    public Menu getMenu() {
        return this.menu;
    }
    
    public void setMenu(Menu menu) {
        this.menu = menu;
    }
    
    @Column(name="state", nullable=false, length=1)
    public char getState() {
        return this.state;
    }
    
    public void setState(char state) {
        this.state = state;
    }
    
    @Column(name="name", nullable=false, length=30)
    public String getName() {
        return this.name;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    
    @Column(name="description", length=30)
    public String getDescription() {
        return this.description;
    }
    
    public void setDescription(String description) {
        this.description = description;
    }
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="registry_date", length=29)
    public Date getRegistryDate() {
        return this.registryDate;
    }
    
    public void setRegistryDate(Date registryDate) {
        this.registryDate = registryDate;
    }
    
    @Column(name="page_name", length=30)
    public String getPageName() {
        return this.pageName;
    }
    
    public void setPageName(String pageName) {
        this.pageName = pageName;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="subMenu")
    public Set<RolesAccion> getRolesAccions() {
        return this.rolesAccions;
    }
    
    public void setRolesAccions(Set<RolesAccion> rolesAccions) {
        this.rolesAccions = rolesAccions;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="subMenu")
    public Set<RolesAccion> getRolesAccions_1() {
        return this.rolesAccions_1;
    }
    
    public void setRolesAccions_1(Set<RolesAccion> rolesAccions_1) {
        this.rolesAccions_1 = rolesAccions_1;
    }




}


